Release 10.1A: OpenEdge Development:
Programming Interfaces


Basic tasks of a Progress SAX application

A typical Progress SAX application does the following:

  1. Creates a SAX-reader object.
  2. Runs a persistent procedure that contains the callbacks.
  3. Configures the SAX-reader object by:
    1. Setting its HANDLER attribute to the handle of the routine that contains the callbacks.
    2. Turning namespace processing and validation on or off as desired.
    3. Specifying the input source using the SET-INPUT-SOURCE() method.
  4. Starts the parser by calling SAX-PARSE() or SAX-PARSE-FIRST().
  5. Handles XML data passed to the callbacks as the parser proceeds.
  6. Monitors the state of the parse by checking error codes and the parse status after each call to SAX-PARSE(), SAX-PARSE-FIRST(), and SAX-PARSE-NEXT().
  7. Releases resources, including deleting the SAX-reader object.

Most of these tasks can be performed using the attributes and methods of the SAX-reader object, which are summarized in Table 20–8.

Table 20–8: Tasks handled by the attributes and methods of SAX-reader
To perform this task...
Use this attribute or method...
Specify the XML input.
SET-INPUT-SOURCE() method.
Specify a search path for the DTD.
SCHEMA-PATH attribute.
Specify the location of XML Schema files with namespace/location pairs.
SCHEMA-LOCATION attribute
ADD-SCHEMA-LOCATION( ) method
Specify the location of the XML schema used to validate XML elements that do specify a namespace.
NONAMESPACE-SCHEMA-LOCATION attribute
Tell the parser where the callbacks reside.
HANDLER attribute.
Toggle parser options.
SUPPRESS-NAMESPACE-PROCESSING attribute.
VALIDATION-ENABLED attribute.
Start, continue, or stop parsing.
SAX-PARSE() method.
SAX-PARSE-FIRST() method.
SAX-PARSE-NEXT() method.
STOP-PARSING() method.
Get the status of the parse.
LOCATOR-COLUMN-NUMBER attribute.
LOCATOR-LINE-NUMBER attribute.
LOCATOR-PUBLIC-ID attribute.
LOCATOR-SYSTEM-ID attribute.
PARSE-STATUS attribute.
Get or set information concerning this particular SAX-reader object.
PRIVATE-DATA attribute.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095